#!/usr/bin/python
# -*- coding: utf-8 -*-
# File: toolbars.py
# Author: Tomás Vírseda
# License: GPL v3
# Description:  toolbars

import gtk

class Toolbar:
    def __init__(self):
        pass
    
    def add_button(icon, label, function, tip=None):
        pass


class ToolbarResource(Toolbar):
    def __init__(self, gui):
        Toolbar.__init__(self)
        self.gui = gui
        
        self.gui.frontend['rtoolbar'] = self.gui.glade.widgets.get_widget("tlbResOp")
        self.add_standard_buttons()
        
    def add_button(self, icon, label, function, tip=None):
        button = gtk.ToolButton(gtk.STOCK_UNDERLINE)
        if tip:
            button.set_tooltip_markup(tip)
        button.connect('clicked', function)
        self.gui.frontend['rtoolbar'].insert(button, -1)
        
    def add_standard_buttons(self):
        # tag this
        icon = gtk.image_new_from_stock(gtk.STOCK_UNDERLINE, 32)
        markup = u"<b>Hola mundo</b>\nQué tal"
        self.add_button(icon, "Tag this", self.gui.actions.do_nothing, markup)
    
class ToolbarMain(Toolbar):
    def __init__(self, gui):
        Toolbar.__init__(self)
        self.gui = gui
    
